//二进制1的个数
#include <iostream>
#include <vector>
using namespace std;
int count(int n)
{
    vector<int> v;
    while(n!=0)
    {
        v.push_back(n%2);
        n/=2;
    }
    int cou=0;
    for(int i=0;i<v.size();i++)
    {
        if(v[i]==1)
            cou++;
    }
    return cou;
}

int main()
{
    int n;
    while(cin>>n)
    {    
    cout<<count(n)<<endl;
    }
    return 0;
}

#include<limits.h>

//手套
class Gloves {
public:
    int findMinimum(int n, vector<int> left, vector<int> right) {
        // write code here
        int leftsum=0;  int leftmin=INT_MAX;
        int rightsum=0; int rightmin=INT_MAX;
        
        int sum=0;
        for(int i=0;i<n;++i)
        {
            if(left[i]*right[i]==0)
            {
                sum=sum+left[i]+right[i];
            }
            else
            {
                leftsum+=left[i];
                leftmin=min(leftmin,left[i]);
                rightsum+=right[i];
                rightmin=min(rightmin,right[i]);
            }
        }
        return sum+min(leftsum-leftmin+1,rightsum-rightmin+1)+1;
    }
};